package com.jiajiankang.myspace;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.jiajiankang.R;
import com.jiajiankang.index.Main;
import com.jiajiankang.index.sixButton;
import com.jiajiankang.more.More;

public class MySpace extends sixButton {
	private Button myspace_bt1;
	private Button myspace_bt2;
	private Button myspace_bt3;
	private Button myspace_bt4;
	private Button myspace_bt5;
	private Button myspace_bt6;
	private Button myspace_bt7;
	private Button myspace_bt8;
	private Button myspace_bt9;
	private Button myspace_logout;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.myspace);
		myspace_bt1 = (Button) findViewById(R.id.myspace_btna);
		myspace_bt2 = (Button) findViewById(R.id.myspace_btnb);
		myspace_bt3 = (Button) findViewById(R.id.myspace_btnc);
		myspace_bt4 = (Button) findViewById(R.id.myspace_btnd);
		myspace_bt5 = (Button) findViewById(R.id.myspace_btne);
		myspace_bt6 = (Button) findViewById(R.id.myspace_btnf);
		myspace_bt9 = (Button) findViewById(R.id.myspace_btni);
		myspace_bt7 = (Button) findViewById(R.id.myspace_btng);
		myspace_bt8 = (Button) findViewById(R.id.myspace_btnh);
		myspace_bt9 = (Button) findViewById(R.id.myspace_btni);
		myspace_logout = (Button) findViewById(R.id.myspace_logout);

		myspace_bt5.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(MySpace.this, DeliveryEnd.class);
				startActivity(intent);
			}
		});
		myspace_bt7.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(MySpace.this, MyFavor.class);
				startActivity(intent);
			}
		});
		myspace_bt8.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(MySpace.this, MyGinkgo.class);
				startActivity(intent);
			}
		});
		myspace_logout.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MySpace.this, Main.class);
				startActivity(intent);
				MySpace.this.finish();
			}
		});
		myspace_bt1.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MySpace.this, WaitPay.class);
				startActivity(intent);
				MySpace.this.finish();
			}
		});
		myspace_bt3.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MySpace.this, AllOrder.class);
				startActivity(intent);
				MySpace.this.finish();
			}
		});
		myspace_bt2.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MySpace.this, WaitDeliver.class);
				startActivity(intent);
				MySpace.this.finish();
			}
		});
		myspace_bt4.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MySpace.this, MybaseinfoActivity.class);
				startActivity(intent);
				MySpace.this.finish();
			}
		});
		myspace_bt6.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MySpace.this, Acount.class);
				startActivity(intent);
				MySpace.this.finish();
			}
		});
		myspace_bt9.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MySpace.this, Security.class);
				startActivity(intent);
				MySpace.this.finish();
			}
		});

		myClickHandler();
	
		six_personal_center.setImageDrawable(getResources().getDrawable(R.drawable.six_person_center_2));
		six_personal_center.setBackgroundResource(R.drawable.btn_press);
	}
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		if(keyCode == KeyEvent.KEYCODE_BACK)
		{
			Intent intent= new Intent(MySpace.this,Main.class);
			startActivity(intent);
			return true;
		}
		else 
			return super.onKeyDown(keyCode, event);
		
	}
}
